#include <iostream>
#include <vector>

using namespace std;

class Animal {
   public:
    virtual void toBark();
};

void Animal::toBark() {}

class Cat : public Animal {
    void toBark() override { cout << "miaomiaomiao" << endl; }
};

class Dog : public Animal {
    void toBark() override { cout << "wangwangwang" << endl; }
};

class Factory {
   public:
    static Animal* Create(int i) {
        if (i == 1)
            return new Dog;
        else if (i == 2)
            return new Cat;
        else
            return nullptr;
    }
};

int main(int argc, char const* argv[]) {
    vector<Animal*> vec;
    vector<Animal*>::iterator iter;

    int count, type;
    cin >> count;
    for (int i = 0; i < count; ++i) {
        cin >> type;
        vec.emplace_back(Factory::Create(type));
    }

    for (iter = vec.begin(); iter != vec.end(); ++iter) {
        (*iter)->toBark();
    }
    return 0;
}